<?php echo $this->doctype() ?>
<html xmls="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>
            <?= (!is_null($this->pageTitle)) ? $this->pageTitle : "Scoring your Games"; ?>
        </title>
        <?php echo $this->headLink()->appendStylesheet($this->baseUrl().'/resources/css/style.css') ?>
    </head>
    <body>
        <div id="left">
            <div id="head">
                <?php echo $this->translate("Scoring your Games!"); ?>
            </div>
            <?php echo $this->layout()->content ?>
        </div>
        <div id="right">
            <div id="mainmenu">
                <?php if (!$this->account) { ?>
                <p><a href="<?= $this->baseUrl();?>/account/login"><?php echo $this->translate("Login"); ?></a></p>
                <p> <a href="<?= $this->baseUrl();?>/account/register"><?php echo $this->translate("Register"); ?></a></p>
                <?php } else { ?>
                    Welcome back, <a href="<?= $this->baseUrl();?>/account/"><?= $this->account->getUsername(); ?></a>  <a href="/account/logout"><?php echo $this->translate("Logout"); ?></a>
                <?php } ?>
            </div>
            <?php
            if (count($this->messages) > 0) {
                printf("<div id='flash'>%s</div>", $this->messages[0]);
            }
            ?>
        </div>
        <div style="clear:both"></div>

        <div id="buttommenu">
            <a href="<?php
            echo $this->url(
                    array('controller' => 'messages'), 'default', true)
            ?>"><?php echo $this->translate("Messages"); ?></a>
            <a href="<?php
               echo $this->url(
                       array('controller' => 'about'), 'default', true)
            ?>"><?php echo $this->translate("About"); ?></a>
            <a href="<?php
               echo $this->url(
                       array('controller' => 'faq'), 'default', true)
            ?>"><?php echo $this->translate("FAQ"); ?></a>
            <a href="<?php
               echo $this->url(
                       array('controller' => 'conntact'), 'default', true)
            ?>"><?php echo $this->translate("Conntact"); ?></a>
        </div>
    </body>
</html>